using System.Collections.Generic;
using System.Linq;
using NodeCanvas.Variables;

namespace NodeCanvas.Actions
{
	[Category("✫ Blackboard")]
	[Description("Remove a number of strings from the target list")]
	public class RemoveListStrings : ActionTask
	{
		[RequiredField]
		[BlackboardOnly]
		public BBStringList targetList;

		public List<BBString> stringsToRemove;

		protected override void OnExecute()
		{
			foreach (string item in stringsToRemove.Select((BBString bbString) => bbString.value))
			{
				targetList.value.Remove(item);
			}
			EndAction(true);
		}
	}
}
